import Vue from 'vue'
import VueRouter from 'vue-router'

// 路由组件引入
// 首页
const Index = () => import('views/Index.vue')
const Search = () => import('views/index/search.vue')
const Recommend = () => import('views/index/recommend .vue')

// 登录注册
const Login = () => import('views/login/login.vue')
const Register = () => import('views/login/register.vue')

// 旅行
// const Lx = () => import('views/lx/lx.vue')
import Lx from 'views/lx/lx.vue'
// const Lvxq = () => import('views/lx/lvxq.vue')
import Lvxq from 'views/lx/lvxq.vue'
// const Jiesuan = () => import('../views/lx/jiesuan.vue')
import Jiesuan from '../views/lx/jiesuan.vue'

// 找攻略
const Zgl = () => import('views/zgl/zgl.vue')
const ZglDetails = () => import('views/zgl/zgldetails.vue')

// 达人
const Dr = () => import('views/daren/dr.vue')

// 头脑风暴
const Tn = () => import('views/tn/tn.vue')

// 酒店
const Hotel = () => import('views/jiudian/hotel.vue')
const HotelX = () => import('views/jiudian/hotelX.vue')
const Jiudian = () => import('views/jiudian/jiudian.vue')
const JiudianDetail = () => import("views/jiudian/jiudianDetail");

// 机票
const Jip = () => import('views/jipiao/jip.vue')
const Jpsou = () => import('views/jipiao/jip_search.vue')

// 尚未开发的功能
const Youji = () => import('views/uncultivated/youji.vue')
const Ddwl = () => import('views/uncultivated/ddwl.vue')

Vue.use(VueRouter)

// 组件注册路由地址
const routes = [
    // 尚未开发的功能
    // 游记
    {
        path: "/youji",
        component: Youji,
    },// 当地玩乐
    {
        path: "/ddwl",
        component: Ddwl,
    },
    // 酒店详情
    {
        path: "/jiudianDetail",
        component: JiudianDetail,
    },
    // 选择酒店路由
    {
        path: '/jiudian',
        component: Jiudian
    },
    // 头脑风暴路由
    {
        path: '/tn',
        component: Tn
    },
    // 机票搜索路由
    {
        path: '/jps',
        component: Jpsou
    },
    // 机票路由
    {
        path: '/jip',
        component: Jip
    },
    // 酒店地址详情
    {
        path: '/hotelx',
        component: HotelX
    },
    // 搜索路由
    {
        path: '/search',
        component: Search
    },
    // 酒店路由
    {
        path: '/hotel',
        component: Hotel
    },
    // 结算路由
    {
        path: '/jiesuan',
        component: Jiesuan
    },
    // 问答路由
    {
        path: '/dr',
        component: Dr
    },
    // 找攻略详情页路由
    {
        path: '/zgldetails/:id',
        component: ZglDetails
    },
    // 找攻略路由
    {
        path: '/zgl',
        component: Zgl
    },
    // 去旅游详细展示
    {
        path: '/lvxq',
        component: Lvxq
    },
    // 去旅行路由
    {
        path: '/lx',
        component: Lx
    },

    // 注册路由
    {
        path: '/register',
        component: Register
    },
    // 登录路由
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    // 首页推荐攻略详情
    {
        path: '/recommend',
        component: Recommend
    },
    // 首页路由
    {
        path: '/index',
        component: Index
    },
    // 默认跳转地址
    {
        path: '',
        redirect: '/index'
    },
]


const router = new VueRouter({
    mode: 'history',// 打包需要把这行注释掉
    routes
})

export default router